//
//  UIView+ZSMasonry.h
//  Epayment
//
//  Created by safiri on 2018/6/13.
//  Copyright © 2018年 safiri. All rights reserved.
//

#import <UIKit/UIKit.h>

@interface UIView (ZSMasonry)


/**
 横向等间隙排列子view,每个子view对于父view上下左右的间隙由edgeInsets控制
 
 @param views 子view数组
 @param space 子view之间的间隙
 @param edgeInsets 子view与父view之间的间隙
 */
- (void)distributeSpacingHorizontally:(NSArray<UIView *>*)views withSpace:(CGFloat)space andEdge:(UIEdgeInsets)edgeInsets;


/**
 横向纵向按指定间距排列子Views
 
 @param views 子View数组
 @param spaceH 水平间距
 @param spaceV 垂直间距
 @param columns 一行上的列数
 @param edgeInsets 边距
 */
- (void)distributeSpacingHorizontally:(NSArray<UIView *>*)views SpaceH:(CGFloat)spaceH SpaceV:(CGFloat)spaceV Columns:(NSInteger)columns Edge:(UIEdgeInsets)edgeInsets;


/**
 横向等间隙排列子view,左右有间隙 提前addSubView
 间隙大小=(父view宽度-子view宽度和)/子view个数+1
 
 @param views 子views
 */
- (void)distributeEqualSpacingHorizontallyWith:(NSArray*)views;


/**
 纵向等间隙排列子view,上下有间隙 提前addSubView
 间隙大小=(父view高度-子view高度和)/子view个数+1
 
 @param views 子views
 */
- (void)distributeEqualSpacingVerticallyWith:(NSArray*)views;

@end
